package file;

import java.io.File;

/**
 * @description: TODO
 * @author yumo
 * @version: 1.0
 * @date 2025/3/14 11:43
 */
public class ListFilesDemo {
    public static void main(String[] args) {
        File dir=new File("E:/");
        if (dir.isDirectory()){
            File[]subs=dir.listFiles();
            System.out.println("子项数量"+subs.length);
            for (File sub:subs){
                System.out.println(sub.getName());
            }
        }
    }
}
